home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / swtools / trubasic / rolldemos / demos / 3d / topo3.tru < prev    next >
Text File  |  1994-08-02  |  1KB  |  60 lines

  1. !
  2. !  TOPO3
  3. !
  4. !  Demonstrate Tplot used to complement Zplot.
  5. !  Designed for computers with lots of colors.
  6. !  Silicon Graphics Personal Iris Version.
  7. !
  8. LIBRARY "3dcont.trc"
  9.  
  10. CALL tw_wset_title(0,"Topo3")
  11. CALL tw_wset_size(0,750,750)
  12.  
  13. clear
  14. ASK MAX COLOR mc
  15. IF mc > 4 then                    !hi resolution - Personal Iris
  16.    CALL SetColor3("10 [.01] 9 [.1] 12 [.5] 13 [1] 15 [2] yellow")
  17.    CALL SetZlines3(80)
  18. ELSE IF mc > 1 then               !medium resolution
  19.    CALL SetColor3("green [.01] yellow [.1] red [.5] green [1] yellow [2] red")
  20.    CALL SetZlines3(40)
  21.    SET BACK "blue"
  22. ELSE                              !monochrome
  23.    CALL SetZlines3(80)
  24. END IF
  25. CALL SetZseg3(125)
  26. CALL PersWindow(-pi,pi,-pi,pi,-6,1.2)
  27. CALL SetCamera3(-15,-25,18)
  28. CALL SetScale3(1.5,1.2)
  29. CALL Zplot
  30. IF mc > 4 then
  31.    SET COLOR "blue"
  32.    CALL Block3(-pi,pi,-pi,pi,-6.5,-6,"blue","blue","cyan",0)
  33. ELSE
  34.    CALL Block3(-pi,pi,-pi,pi,-6.5,-6,"1","1","0",0)
  35. END IF
  36. CALL SetMesh3(50,50)
  37. CALL SetTlines3(15)
  38. CALL Tplot(-6)
  39. IF mc > 4 then
  40.    SET COLOR "red"
  41.    ASK WINDOW x1,x2,y1,y2
  42.    !FLOOD x1,y1     ! slow for X windows
  43. END IF
  44. get point x,y
  45. END
  46.  
  47. !
  48. !
  49. !  Our function to plot.  A strange one with two lumps.
  50. !
  51. DEF F(x,y)
  52.     LET x1 = x-1
  53.     LET y1 = y-1
  54.     LET a = x1*x1 + y1*y1
  55.     LET x1 = x+1
  56.     LET y1 = y+1
  57.     LET b = x1*x1 + y1*y1
  58.     LET F = 1.5*cos(1.75*b)*exp(-.4*b) + 3.5*cos(1.75*a)*exp(-.8*a)
  59. END DEF
  60.